<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <?php
            include("../Service/WebClass/report/AdGroupService.php");
            $AdGroupService = new AdGroupService();

            if(isset($_POST['option']))
            {
                $message = $AdGroupService->addAdGroup();
                echo "<script language='javascript'>alert(\"".$message."\");window.close();</script>";
            }
        ?>
        <title>広告グループ追加画面</title>
        <link rel="stylesheet" href="../css/common.css" type="text/css" />
        <script language="JavaScript" src="../js/InputCheck.js" type="text/javascript"></script>
    </head>
    <body>
        <div class="input_area">
            <form name="inputform" method="post">
                <input type="hidden" name="option" value="add"/>
                <table width="100%" border="0" cellpadding="2" cellspacing="0">
                    <tbody><tr>
                            <td align="right">
                                <input class="btn close" onclick="javascript:self.close();" type="button">
                            </td>
                        </tr>
                </tbody></table>
                <table width="100%" border="0" cellpadding="2" cellspacing="0">
                    <tbody><tr>

                            <td align="right">
                                <input class="btn save" value="" type="submit" onclick="return checkInput_adgroup()">
                            </td>
                        </tr>
                </tbody></table>
                <table class="tbl" width="100%" border="0" cellpadding="4" cellspacing="0">
                    <tbody><tr>
                            <td class="td9" width="150" align="left">媒体</td>

                            <td class="td4 left"><?php echo $_GET['listingName']; ?></td>
                        </tr>
                        <tr>
                            <td class="td9 top" align="left">キャンペーン</td>
                            <td class="td4 border"><?php echo $AdGroupService->campaignName;?></td>

                        </tr>
                        <tr>
                            <td class="td9 top" align="left"><span class="required">広告グループ名</span></td>
                            <td class="td4 border">
                                <input name="adgroup_name" size="60" maxlength="100" value="<?php echo $_POST['adgroup_name'];?>" class="txBox" type="text">
                            </td>
                        </tr>
                        <tr style="display:none;">

                            <td class="td9 top" align="left">ランディングページURL(既定値)</td>
                            <td class="td4 border">
                                <input name="landing_url" size="80" maxlength="1000" value="<?php echo $_POST['landing_url'];?>" class="txBox" type="text">
                                <br>
                                <input name="count_by_creative" id="count_by_creative0" value="0" checked="checked" type="radio"><label for="count_by_creative0">キーワード単位で計測</label>
                                <input name="count_by_creative" id="count_by_creative1" value="1" type="radio"><label for="count_by_creative1">クリエイティブ単位で計測</label>
                            </td>
                            <?php
                                if($_POST['count_by_creative'] == "1")
                                {
                                    echo "<script>document.inputform.count_by_creative[1].checked=true;</script>";
                                }
                                else
                                {
                                    echo "<script>document.inputform.count_by_creative[0].checked=true;</script>";
                                }
                            ?>

                        </tr>
                        <tr>
                            <td class="td9 top">スポンサードサーチ</td>
                            <td class="td4 border">
                                最高入札額
                                <input name="sponsored_maxbid" size="6" maxlength="10" value="<?php echo $_POST['sponsored_maxbid'];?>" class="txBox" type="text">
                            </td>
                        </tr>
                        <tr>
                            <td class="td9 top">コンテンツマッチ</td>
                            <td class="td4 border">
                                最高入札額
                                <input name="content_maxbid" size="6" maxlength="10" value="<?php echo $_POST['content_maxbid'];?>" class="txBox" type="text">
                            </td>
                        </tr>
                        <tr>
                            <td class="td9 top" align="left">掲載オン/オフ</td>
                            <td class="td4 border">
                                <input name="status" id="status1" value="1" checked="checked" type="radio"><label for="status1">オン</label>

                                <input name="status" id="status0" value="0" type="radio"><label for="status0">オフ</label>
                            </td>
                            <?php
                                if($_POST['status'] == "0")
                                {
                                    echo "<script>document.inputform.status[1].checked=true;</script>";
                                }
                                else
                                {
                                    echo "<script>document.inputform.status[0].checked=true;</script>";
                                }
                            ?>
                        </tr>

                </tbody></table>
                <table width="100%" border="0" cellpadding="2" cellspacing="0">
                    <tbody><tr>
                            <td align="right">
                                <input class="btn save" value="" onclick="return checkInput_adgroup()" type="submit">
                            </td>

                        </tr>
                </tbody></table>
            </form>
        </div>
    </body>
</html>
